﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tema
{
    class CarPool
    {
        private Queue<AbstractCar> _pool = null;

        public CarPool()
        {
            if (_pool == null)
                _pool = new Queue<AbstractCar>();
        }

        public AbstractCar getCar()
        {
            return _pool.Dequeue();
        }

        public void addCar(AbstractCar car)
        {
            _pool.Enqueue(car);
        }

        public int getCount()
        {
            return _pool.Count;
        }
    }
}
